/**
 * Created by admin on 2016/9/8.
 */

function checkLocalUser() {
    var uid = getCookie("fy_loc_uid");
    var uto = getCookie("fy_loc_token");
    if (uid == null || uto == null) {
        return '';
    }
    else {
        return uid;
    }
}

function checkMobilePhone (mobnum) {
    //确认手机号码
    if (mobnum == null || mobnum == '') return "手机号不能为空";
    //是否为数字
    if (isNaN(mobnum)) return "手机号码必须为数字";
    //确认手机号码长度
    if (mobnum.length != 11) return "请输入11位手机号码";
    //是否为1开头
    if (mobnum.substring(0, 1) != '1') return "手机号码必须为1开头的数字";
    return '';
}

function checkEmail (email) {
    //对电子邮件的验证
    var myreg = /^([a-zA-Z0-9]+[_|\_|\.]?)*[a-zA-Z0-9]+@([a-zA-Z0-9]+[_|\_|\.]?)*[a-zA-Z0-9]+\.[a-zA-Z]{2,3}$/;
    if(!myreg.test(email)) return false;
    return true;
}

function checkPageExit (page) {
    var pg = getCookie(page);
    if (pg != null && pg == 'exit') {
        setCookie(page, "");
        return true;
    }
    return false;
}

function loguid () {
    var uid = getCookie("fy_loc_uid");
    var uto = getCookie("fy_loc_token");
    alert (uid + " " + uto);
}